[<<Previous Entry]
[^^Up^^]
[Next Entry>>]
[Menu]
[About The Guide]
A_()
Return a pointer reference to a multi-dimensional array element
-------------------------------------------------------------------------------
Syntax
A_( <nElements>,
[, <nElements>...] ) -> nPointer
Arguments
<nElements> represents the magnitude of each successive dimension
in a FlexFile array.
Returns
A_() returns a character string which FlexFile interprets as a
pointer to the specific element.
Description
Use A_() to simplify passing/receiving multi-dimensional array
index references. The need for the function arises because array
indexes have as many components as the array has dimensions and
the passing of the index to a function can get confusing (both for
the programmer and FlexFile's error checking).
With Clipper arrays the compiler handles references to a
particular element with the familiar syntax [ 1 ][ 1 ][ 1 ] for
the first element of a three dimensional array. Avoiding conflict
with this syntax, FlexFile refers to the same element of a
FlexFile three dimensional array as A_( 1, 1, 1 ).
Although FlexFile functions will accept a numeric integer as an
array index designator (it is the preferred method on a FlexFile
single dimensional array), you should not use integers as indexes
to multi- dimensional arrays. This is because A_( 3, 5 ) does not
refer to the same element as A_(5, 3), and rarely if ever does
(3 * 5) point to element A_(3, 5).
See the examples for a complete understanding of the use of this
function.
Examples
// Accessing elements of a FlexFile Multi-dimensional array
// First declare a two dimensional 5 x 10 array.
rows = 5
cols = 10
aName = A_DECLARE( 'F', rows, cols )
// Fill the array starting at the first element a_( 1, 1 ).
A_FILL( aName, 98.6, A_( 1, 1 ), rows * cols )
// Retrieve a value from a specified element.
temp = A_RETRIEVE( aName, A_( 3, 2 ) )
See Also:
A_RETRIEVE()
A_STORE()
This page created by ng2html v1.05, the Norton guide to HTML conversion utility.
Written by Dave Pearson